
import { createStore } from 'vuex'
import type { StateType } from './index.d'

const files = import.meta.glob('./modules/*.ts', { eager: true })

const keys = Object.keys(files)

const modules : any = {}

keys.forEach((key : any) => {
	if (Object.prototype.hasOwnProperty.call(files, key)) {
		
		modules[key.replace(/(\.\/modules\/|\.ts)/g, '')] = (files[key] as any).default
	}
})

export interface rootStateType { }

export default createStore<StateType>({
	modules
})